﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using flsfragusseModel;

public partial class dealersubvention : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["flsPartnerWebID"] != null && Session["flsPartnerWebType"] != null)
        {
            //   string test = Session["flspartnerwebtype"].ToString();
        }
        else
        {
            Response.Redirect("default.aspx?error=1");
        }
        if (!IsPostBack)
        {
            LoadSubvention();
            lblreferer.Text = Request.UrlReferrer.PathAndQuery.ToString();
        }

       
    }

    private void LoadSubvention()
    {

        flsfragusseEntities1 cEntity = new flsfragusseEntities1();

      //  int dealerID = Convert.ToInt32(drpDealers.SelectedValue);
          List<tblProduct> tblproduct = (from p in cEntity.tblProduct
                                 where p.partnerID == 3
                                 select p).ToList();

          tblProduct tblproduct2 = null;
          if (tblproduct.Count > 0)
          {

              tblproduct2 = tblproduct[0];


              txtbox1.Text = Convert.ToString(tblproduct2.dealerSubvention);

          }


     //   grdSalesMen.DataBind();


    }

    private void SaveSubvention()
    {

    }

    
    protected void btn1_Click(object sender, EventArgs e)
    {
        Response.Redirect(lblreferer.Text);
    }
  
    protected void btnSave_Click1(object sender, EventArgs e)
    {

    }
}